[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
STRING(EXP) (STRING)
Function
Convert any expression to a string.
Syntax
STRING(exp)
exp = Any expression.
Return Type & Value
STRING
Returns exp formatted as a string.
Remarks
This function is immensely useful anytime you need to convert any
expression to string format. For example, to append an integer value to
the end of a string without this function, you would need to assign the
integer to a string and then append the temporary string to actual
string. This is because PPL's normal course of action when performing
arithmetic with incompatible types is to convert everything to integer
first. With this function, you can accomplish the same function in one
line of code with one expression because you are forcing addition of
compatible types (strings). Note that PPL does automatically convert
incompatible types whenever possible, making this function unnecessary
in many cases. This function should only be necessary when trying to
append the text representation of a non-string type to a string via the
+ operator.
Examples
INTEGER i
STRING s(5)
FOR i = 1 to 5
LET s(i) = "This is string "+STRING(i)
NEXT
STRING s
LET s = STRING(ABORT())+" "+STRING(DATE())+" "+STRING(10)+" "
LET s = s+STRING($10.00)+" "+STRING(TIME())
PRINTLN s ' will print "0 10-31-67 10 $10.00 03:27:00" (or similar)
See Also:
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson